package com.pauldada.sakurabbs.dao;

import com.pauldada.sakurabbs.entities.WebSiteInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

//帖子Repository接口
public interface WebSiteInfoRepository extends JpaRepository<WebSiteInfo, Integer>,JpaSpecificationExecutor<WebSiteInfo>{

	//根据帖子id查询动态信息
	@Query(value="select * from t_info where film_id=?1",nativeQuery = true)
    List<WebSiteInfo> getByFilmId(Integer filmId);
	
	//根据帖子网站id查询动态信息
	@Query(value="select * from t_info where web_site_id=?1",nativeQuery = true)
    List<WebSiteInfo> getByWebSiteId(Integer webSiteId);
}
